package util;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class MySystem {
	public static BufferedWriter out = null;
	static {
		 try {
			out = new BufferedWriter(new FileWriter(
					"D:\\answer.txt"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void println(String str) {
		System.out.println(str);
		try {
			out.write(str);
			out.newLine();
			out.flush();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
	
	public static void close(){
		if(out != null){
			try {
				out.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
